<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        var year = prompt('请输入年份');
        function backDay(year) {
            if (isLeapYear(year)) {
                alert(year+'是润年，有29天');
            }else{
                alert(year+'不是润年，有28天');
            }
        }
        backDay(year);
        function isLeapYear(year) {
            var flag = false;
            if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
                flag = true;
            }
            return flag;
        }
    </script>
</body>

</html>